<?php
/**
* @file Specialtym.php
* @synopsis 用户专业
* @author Yee, <rlk002@gmail.com>
* @version 1.0
* @date 2015-03-11 17:31
*/


class Specialtym extends CI_Model
{
	function __construct()
	{
	}


	/**
	*  这个在新接口已经作废
	*
	*
	**/
	public function getSpecialtyInfoById($specialty)
	{
		return $this->db->select("specialty_name")->from("ml_specialty")->where(array("specialty_code"=>$specialty))->get()->result_array();
	}

	public function get_thread_info_by_id($thread)
	{
		switch ($thread) {
			case '-1':
				return $return =  '医学生';
				break;
			case '-2':
				return $return =  '实习医生';
				break;
			default:
				$result = $this->db->select("thread_name")->from("ml_thread")->where(array("id"=>$thread))->get()->result_array();
				return $return = $result[0]['thread_name'];
				break;
		}
	}

	public function get_specialt_list()
	{
		$query = $this->db->select()->from('ml_specialty')->get()->result_array();
		$data = array();
		foreach($query AS $v)
		{
			$data[$v['specialty_code']] = $v;
		}
		return $data;
	}

	public function get_thread_list()
	{
		$query = $this->db->select()->from('ml_thread')->get()->result_array();
		$data = array();
		foreach($query AS $v)
		{
			$data[$v['id']] = $v;
		}
		return $data;
	}
}	
